#include <iostream>
using namespace std;
typedef long long ll;
const int N = 1000000007 , M=1e7+10;
ll f[M];
ll g[M];
int main() {
    int n;
    cin >> n;
    f[1]=1;
    g[1]=2;
    for(int i=2;i<=n;i++)
    {
        f[i]=(2*g[i-1]+1)%N;
        g[i]=(f[i-1]+2+(2*g[i-1])%N)%N;
    }
    cout << f[n] << " " << g[n];
    return 0;
}